package com.vitalfit.model.entity.user;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.vitalfit.model.entity.fitness.Appointment;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;
import java.util.HashSet;
import java.util.Set;

@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@DiscriminatorValue("Trainer")
public class Trainer extends User {


    private int starRating;

    private double salary;

    private int age;

    private LocalDate startDate;

    @JsonIgnore
    private Boolean isDeleted = false;

    @OneToMany(mappedBy = "trainer", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JsonIgnore
    private Set<Appointment> appointments = new HashSet<>();


}

